package com.longfa.ojbackendjudgeservice;

import com.longfa.ojbackendjudgeservice.message.InitRabbitMQ;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableScheduling;

import javax.annotation.PostConstruct;

/**
 * @EnableFeignClients(basePackages = "com.hmall.api.client", defaultConfiguration = DefaultFeignConfig.class)
 * 上述的注解的 basePackages参数 是： 提供内部服务连接（客户端）接口的 包的全路径
 */
@SpringBootApplication
@ComponentScan("com.longfa")
@EnableFeignClients(basePackages = "com.longfa.ojbackendserviceclient")
@EnableDiscoveryClient
@EnableScheduling
@EnableAspectJAutoProxy(proxyTargetClass = true, exposeProxy = true)
public class OjBackendJudgeServiceApplication {

    public static void main(String[] args) {

        // 先初始化消息队列
        InitRabbitMQ.doInit();
        SpringApplication.run(OjBackendJudgeServiceApplication.class, args);

    }

/*    @PostConstruct
    public void init() {
//        InitRabbitMQ.doInit();

    }*/
}
